
{extend name='public/base' /}

{block name="content"}

<div class="layui-col-md12">
    <div class="layui-card">
        <div class="layui-card-body">
            <table class="layui-hide" id="get_course_select_table" lay-filter="get_course_select_table"></table>
        </div>
    </div>

</div>
{/block}

{block name="js"} <!--js处理区-->


<script type="text/html" id="operationTpl">
    {{# if(d.id==0){ }}
     不可编辑
    {{# }else{ }}
    <a href="javascript:;" class="layui-btn layui-btn-normal layui-btn-xs {:node('Admin/addAdmin')}" data-title="编辑订单" lay-event="edit"><i class="layui-icon"></i></a>
    <a href="javascript:;" class="layui-btn layui-btn-danger layui-btn-xs {:node('Admin/del')}" data-title="删除订单" lay-event="del"><i class="layui-icon "></i></a>
    {{# } }}
</script>

<script>
    layui.use(['element', 'table', 'form', 'jquery', 'lucky','opTable'], function () {
        var element = layui.element;
        var form = layui.form;
        var $ = layui.jquery;
        var lucky=layui.lucky;
        var opTable = layui.opTable;
        var table = layui.table;
        form.render();

        var opTables = table.render({
            elem: '#get_course_select_table',
            url:"{:url('admin/Course/index')}",
            even: true, //开启隔行背景
            id:'get_course_select_table_id',
            page: { //支持传入 laypage 组件的所有参数（某些参数除外，如：jump/elem） - 详见文档
                layout: ['limit', 'count', 'prev', 'page', 'next', 'skip','last'] //自定义分页布局
                ,groups: 5 //只显示 1 个连续页码
                ,first: false //不显示首页
                ,last: false //不显示尾页
                ,limit:20
                ,limits:[10,20,30,50]
            },
              // height: 'full-100',100',
            text: {
                none: '暂无相关数据'
            },
            cols: [[
                {type:'checkbox'},
                {field: 'id',  title: '序号',width:60},
                {field: 'CourseType', width:90, title: ' 类别',templet:function (rd) {return rd.CourseType.name}},
                {field: 'CourseYear', width:90, title: '年份',templet:function (rd) {return rd.CourseYear.name}},
                {field: 'class_type', width:90, title: '科目类别'},
                {field: 'name', width:90, title: ' 名称'},
                {field: 'hour', width:90, title: '课时'},
                {field: 'price', width:90, title: '价格(元)'},
                {field: 'status', title: '报名状态',width: 100,align: 'center',templet:function (rd) {
                        var s="";
                        if (rd.status==1){
                            s='<span class="layui-badge layui-bg-green">正常</span>';
                        } else {
                            s='<span class="layui-badge layui-bg-black">禁止</span>';
                        }
                        return s;
                    }},
                {field: 'attribute', title: '首页推荐',width: 100,align: 'center',templet:function (rd) {
                        var s="";
                        if (rd.attribute==1){
                            s='<span class="layui-badge layui-bg-green">是</span>';
                        } else {
                            s='<span class="layui-badge layui-bg-black">否</span>';
                        }
                        return s;
                    }},
                {field: 'create_time', title: '创建时间',align: 'center',width:220,sort:true}
            ]],
            done: function (res) {
                layer.closeAll('loading');
            }
        });


    });

</script >

{/block}
